const express = require('express');
const bodyParser = require('body-parser');
const session = require('express-session');

var app = express();
app.use(express.static('./public'));
app.set("view engine", "ejs");
app.set("views","views");
app.use(bodyParser.json());
app.use(bodyParser.urlencoded());
app.use(session({secret: 'abc'}));


var ristoryRouter = require('../routes/ristory.server.route');
var productRouter = require('../routes/product.server.route');
var userRouter = require('../routes/user.server.route');



app.use('/Warehouse',ristoryRouter);
app.use('/Warehouse',productRouter);
app.use('/Warehouse',userRouter);
app.get('/Warehouse', function(req, res) {
    res.render('index', { title: 'Warehouse' });
});

module.exports = app;